package day12;

import java.math.BigDecimal;
import java.util.Scanner;

public class bigdecimal {
    public static void main(String[] args) {
        f1();

    }

    private static void f1() {
        System.out.println("请输入需要计算的数：");
        double d1=new Scanner(System.in).nextDouble();
        double d2=new Scanner(System.in).nextDouble();
        BigDecimal bd1=new BigDecimal(d1+"");
        BigDecimal bd2=new BigDecimal(d2+"");
        BigDecimal bd3;
        bd3=bd1.add(bd2);
        System.out.println(bd3);
        bd3=bd1.subtract(bd2);
        System.out.println(bd3);
        bd3=bd1.multiply(bd2);
        System.out.println(bd3);
        bd3=bd1.divide(bd2,0,BigDecimal.ROUND_HALF_UP);
        System.out.println(bd3);

    }
}
